//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public License
// along with this program.  If not, see http://www.gnu.org/licenses/.
// 

#include "Request.h"

Request::Request(cXMLElement *requestXml)
{
	id = atoi(requestXml->getFirstChildWithTag("Id")->getNodeValue());
	startTime = atoi(requestXml->getFirstChildWithTag("SendStartTime")->getNodeValue());
	bandwidth = atoi(requestXml->getFirstChildWithTag("Bandwidth")->getNodeValue());
	packetSize = atoi(requestXml->getFirstChildWithTag("DataPacketSize")->getNodeValue());
	dataSendingTime = atoi(requestXml->getFirstChildWithTag("DataSendingTime")->getNodeValue());
	senderId = atoi(requestXml->getFirstChildWithTag("SenderId")->getNodeValue());
	receiverId = atoi(requestXml->getFirstChildWithTag("ReceiverId")->getNodeValue());
}

Request::~Request()
{
	// TODO Auto-generated destructor stub
}

int Request::getStartTime()
{
	return startTime;
}

void Request::setStartTime(int time)
{
	startTime = time;
}

int Request::getBitSize()
{
	return packetSize;
}

int Request::getSenderId()
{
	return senderId;
}

int Request::getReceiverId()
{
	return receiverId;
}

int Request::getId()
{
	return id;
}

int Request::getDataSendingTime()
{
	return dataSendingTime;
}
